<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>putPixels</title>
		<script type="text/javascript" src="../load_lufylegend.js"></script>
	</head>
	<body>
			<div id="legend">
			</div>
			<script>
			LInit(50, "legend", 800, 480, main);
			function main () {
				var loader = new LLoader();
				loader.addEventListener(LEvent.COMPLETE, loadBitmapdata); 
				loader.load("face.jpg", "bitmapData");
			}
			function loadBitmapdata (event) {
				var bitmapData = new LBitmapData(event.target);
				bitmapData2 = new LBitmapData(null, 0, 0, 500, 400, LBitmapData.DATA_CANVAS);
			    bitmapData.lock();
				var img = bitmapData.getPixels(new LRectangle(75, 50, 100, 100));
			    bitmapData.unlock(); 
			    
			    bitmapData2.putPixels(new LRectangle(50, 30, 50, 50), img);
				
				var bitmap = new LBitmap(bitmapData);
				addChild(bitmap);
				
				var bitmap2 = new LBitmap(bitmapData2);
				bitmap2.y = 250;
				addChild(bitmap2);
			}
			</script>
	</body>
</html>